<template>
  <div>
<h1>显示所有用户账号</h1>
<table>
  <tr>
    <td>用户编号</td>
    <td>用户账号</td>
    <td>用户密码</td>
    <td>注册时间</td>
  </tr>
  <tr v-for="item in list">
    <td>{{item.Xid}}</td>
    <td>{{item.ZhangHao}}</td>
    <td>{{item.MiMa.substr(0,4)+'***'}}</td>
    <td>{{item.ShiJIan.substr(0,10)}}</td>
  </tr>
</table>
  </div>
</template>

<script setup lang="ts">
import {reactive,toRefs,onMounted} from 'vue'
import axios from 'axios'
import {useRoute,useRouter} from 'vue-router'
const route=useRoute()
const router=useRouter()

let data:any=reactive({
  list:[],
  state:{

  }
})

let {list,state}=toRefs(data)

onMounted(()=>{
  show()
})

const show=()=>{
axios({
  url:'/api/User/GetLieBiao',
  method:'get',
  params:state.value
})
.then(res=>{
  console.log(res.data);
  list.value=res.data.data;
  console.log(res.data.data.length);
})
.catch(err=>{
  console.log(err);
})
}
</script>

<style scoped>

</style>